package com.dingtalk.dingbotmgr.action;

import java.util.List;

import com.dingtalk.dingbotmgr.model.Company;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * Created by wyx on 2017/2/28.
 */
@Component("companyAction")
@Scope("prototype")
public class CompanyAction extends BaseAction {

    private Company company;

    private List<Company> companyList;

    public String listCompany() {
        companyList = companyService.list();
        return SUCCESS;
    }

    public String saveCompany() {
        companyService.saveOrUpdate(company);
        return SUCCESS;
    }

    public String deleteCompany() {
        companyService.delete(company);
        return SUCCESS;
    }

    public Company getCompany() {
        return company;
    }

    public void setCompany(Company company) {
        this.company = company;
    }

    public List<Company> getCompanyList() {
        return companyList;
    }

    public void setCompanyList(List<Company> companyList) {
        this.companyList = companyList;
    }
}
